<template>
  <div style="height: 100%;">
    <div class="container d-flex">
      <div class="container-left">
        <div class="t-center">
          <el-row>
            <el-button type="primary" size="150">刷新简历</el-button>
          </el-row>
        </div>
        <el-form ref="form" :model="formData.resumeOutVo" label-width="125px">
          <el-form-item label="简历名称:" style="margin: 0;">
            <el-input v-model="formData.resumeOutVo.name" v-if="false"></el-input>
            <span v-if="true">默认简历</span>
            <span>修改</span>
          </el-form-item>
          <el-checkbox-group v-model="formData.resumeOutVo.nation" style="padding: 0 54px; margin-bottom: 20px;">
            <el-checkbox label="1">默认投递该简历</el-checkbox>
            <el-checkbox label="2">加密当前简历</el-checkbox>
          </el-checkbox-group>
        </el-form>
        <div class="menu">
          <el-menu default-active="0" class="el-menu-vertical-demo">
            <el-menu-item v-for="(item,index) in leftSideBar" @click="toScroll(index+1)">
              {{item}}
              <i class="el-icon-arrow-right"></i>
            </el-menu-item>
          </el-menu>
        </div>
      </div>
      <div class="container-right flex-1">
        <el-tabs v-model="resume">
          <el-tab-pane :label="`默认简历`" name="first">
            <div class="head-img d-flex">
              <div class="user-head"><img src="" alt=""></div>
              <div class="flex-1">
                <div class="user-name">崔超兵</div>
                <div class="upload-img-btn">上传照片</div>
              </div>
            </div>
            <div>
              <el-form ref="resumeOutVo" :rules="resumeOutVoRules" :model="formData.resumeOutVo" label-width="80px"
                v-if="!ajaxSuccess">
                <div class="resume-item-title d-flex">
                  <div class="flex-1">
                    <div class="title-text">基本情况</div>
                    <span class=title-border></span>
                  </div>
                  <div>
                    <el-button type="primary" v-if="!isEdit.resumeOutVo.edit" @click="edit(1)">编辑</el-button>
                    <el-button type="primary" v-if="isEdit.resumeOutVo.edit" @click="save(1)">保存</el-button>
                  </div>
                </div>
                <div class="d-flex">
                  <div class="resume-left flex-1">
                    <el-form-item label="姓名" prop="name">
                      <div class="w220">
                        <el-input placeholder="请输入姓名" v-model="formData.resumeOutVo.name" maxlength="20"
                          :disabled="!isEdit.resumeOutVo.edit"></el-input>
                      </div>
                    </el-form-item>
                    <el-form-item label="出生日期">
                      <div class="w220">
                        <el-date-picker type="date" placeholder="请选择出生日期" v-model="formData.resumeOutVo.birthday"
                          :disabled="!isEdit.resumeOutVo.edit" :picker-options="pickerOptions0"
                          value-format="yyyy-MM-dd" style="width: 100%;"></el-date-picker>
                      </div>
                    </el-form-item>
                    <el-form-item label="民族">
                      <div class="w220">
                        <el-select v-model="formData.resumeOutVo.nation" placeholder="请选择民族" style="width: 100%;"
                          :disabled="!isEdit.resumeOutVo.edit">
                          <el-option v-for="item in formData.nation" :key="item.val" :label="item.name"
                            :value="item.val">
                          </el-option>
                        </el-select>
                      </div>
                    </el-form-item>
                    <el-form-item label="政治面貌">
                      <div class="w220">
                        <el-select v-model="formData.resumeOutVo.politicalStatus" placeholder="请选择政治面貌"
                          style="width: 100%;" :disabled="!isEdit.resumeOutVo.edit">
                          <el-option v-for="item in formData.politicalStatus" :key="item.val" :label="item.name"
                            :value="item.val">
                          </el-option>
                        </el-select>
                      </div>
                    </el-form-item>
                    <el-form-item label="现居住地">
                      <div class="w220">
                        <el-cascader :options="options" placeholder="请选择现居住地"
                          v-model="formData.resumeOutVo.currentResidence" style="width: 100%;"
                          :disabled="!isEdit.resumeOutVo.edit"></el-cascader>
                      </div>
                    </el-form-item>
                    <el-form-item label="体重" prop="weight">
                      <div class="d-flex">
                        <div class="w220">
                          <el-input placeholder="请输入体重" v-model="formData.resumeOutVo.weight"
                            :disabled="!isEdit.resumeOutVo.edit" oninput="value=value.replace(/[^\d]/g,'')"></el-input>
                        </div>
                        <span class="flex-1 ml10 c-555555 l-h40">kg</span>
                      </div>
                    </el-form-item>
                    <el-form-item label="工作时间" prop="workTime">
                      <div class="w220">
                        <el-date-picker type="date" placeholder="请选择参加工作时间" v-model="formData.resumeOutVo.workTime"
                          :disabled="!isEdit.resumeOutVo.edit" value-format="yyyy-MM-dd" style="width: 100%;">
                        </el-date-picker>
                      </div>
                    </el-form-item>
                    <el-form-item label="学历" prop="education">
                      <div class="w220">
                        <el-select v-model="formData.resumeOutVo.education" placeholder="请选择学历" style="width: 100%;">
                          <el-option v-for="item in formData.education" :disabled="!isEdit.resumeOutVo.edit"
                            :key="item.val" :label="item.name" :value="item.val">
                          </el-option>
                        </el-select>
                      </div>
                    </el-form-item>
                  </div>
                  <div class="resume-right flex-1">
                    <el-form-item label="身份证号" prop="idCard">
                      <div class="w220">
                        <el-input placeholder="请输入身份证号" v-model="formData.resumeOutVo.idCard"
                          :disabled="!isEdit.resumeOutVo.edit"></el-input>
                      </div>
                    </el-form-item>
                    <el-form-item label="性别" prop="sex">
                      <div class="w220">
                        <el-select v-model="formData.resumeOutVo.sex" placeholder="请选择性别" style="width: 100%;"
                          :disabled="!isEdit.resumeOutVo.edit">
                          <el-option key="1" label="男" value="1"></el-option>
                          <el-option key="2" label="女" value="2"></el-option>
                        </el-select>
                      </div>
                    </el-form-item>
                    <el-form-item label="婚姻状况">
                      <div class="w220">
                        <el-select v-model="formData.resumeOutVo.maritalStatus" placeholder="请选择婚姻状况"
                          style="width: 100%;" :disabled="!isEdit.resumeOutVo.edit">
                          <el-option v-for="item in formData.maritalStatus" :key="item.val" :label="item.name"
                            :value="item.val">
                          </el-option>
                        </el-select>
                      </div>
                    </el-form-item>
                    <el-form-item label="户籍地">
                      <div class="w220">
                        <el-cascader :options="options" placeholder="请选择户籍地"
                          v-model="formData.resumeOutVo.domicilePlace" style="width: 100%;"
                          :disabled="!isEdit.resumeOutVo.edit"></el-cascader>
                      </div>
                    </el-form-item>
                    <el-form-item label="身高" prop="height">
                      <div class="d-flex">
                        <div class="w220">
                          <el-input placeholder="请输入身高" v-model="formData.resumeOutVo.height"
                            oninput="value=value.replace(/[^\d]/g,'')" :disabled="!isEdit.resumeOutVo.edit"></el-input>
                        </div>
                        <span class="flex-1 ml10 c-555555 l-h40">cm</span>
                      </div>
                    </el-form-item>
                    <el-form-item label="视力状况">
                      <div class="w220">
                        <el-select v-model="formData.resumeOutVo.vision" placeholder="请选择视力状况" style="width: 100%;"
                          :disabled="!isEdit.resumeOutVo.edit">
                          <el-option v-for="item in formData.vision" :key="item.val" :label="item.name"
                            :value="item.val">
                          </el-option>
                        </el-select>
                      </div>
                    </el-form-item>
                    <el-form-item label="工作经验" prop="workExp">
                      <div class="d-flex">
                        <div class="w220">
                          <el-select v-model="formData.resumeOutVo.workExp" placeholder="请选择工作经验" style="width: 100%;"
                            :disabled="!isEdit.resumeOutVo.edit">
                            <el-option v-for="item in formData.workExp" :key="item.val" :label="item.name"
                              :value="item.val">
                            </el-option>
                          </el-select>
                        </div>
                        <div class="flex-1 ml10 l-h40">
                          <el-checkbox-group v-model="formData.resumeOutVo.notWorkExp"
                            :disabled="!isEdit.resumeOutVo.edit">
                            <el-checkbox label="无经验" name="type"></el-checkbox>
                          </el-checkbox-group>
                        </div>
                      </div>
                    </el-form-item>
                    <el-form-item label="所学专业">
                      <div class="w220">
                        <el-input placeholder="请输入所学专业" v-model="formData.resumeOutVo.major"
                          :disabled="!isEdit.resumeOutVo.edit"></el-input>
                      </div>
                    </el-form-item>
                  </div>
                </div>
              </el-form>
              <el-form ref="form" :rules="contactWayOutVo" :model="formData.contactWayOutVo" label-width="80px">
                <div class="resume-item-title d-flex">
                  <div class="flex-1">
                    <div class="title-text">联系信息</div>
                    <span class=title-border></span>
                  </div>
                  <div>
                    <el-button type="primary" v-if="!isEdit.contactWayOutVo.edit" @click="edit(2)">编辑</el-button>
                    <el-button type="primary" v-if="isEdit.contactWayOutVo.edit" @click="save(2)">保存</el-button>
                  </div>
                </div>
                <div class="d-flex">
                  <div class="resume-left flex-1">
                    <el-form-item label="手机号" prop="phone">
                      <div class="w220">
                        <el-input v-model="formData.contactWayOutVo.phone" placeholder="请输入手机号"
                          :disabled="!isEdit.contactWayOutVo.edit"></el-input>
                      </div>
                    </el-form-item>
                    <el-form-item label="QQ号">
                      <div class="w220">
                        <el-input v-model="formData.contactWayOutVo.qq" placeholder="请输入QQ号"
                          oninput="value=value.replace(/[^\d]/g,'')" :disabled="!isEdit.contactWayOutVo.edit">
                        </el-input>
                      </div>
                    </el-form-item>

                    <el-form-item label="通讯地址">
                      <div class="w220">
                        <el-input v-model="formData.contactWayOutVo.mailingAddress" placeholder="请输入通讯地址"
                          :disabled="!isEdit.contactWayOutVo.edit"></el-input>
                      </div>
                    </el-form-item>
                  </div>
                  <div class="resume-right flex-1">
                    <el-form-item label="邮箱" prop="mail">
                      <div class="w220">
                        <el-input v-model="formData.contactWayOutVo.mail" placeholder="请输入邮箱"
                          :disabled="!isEdit.contactWayOutVo.edit"></el-input>
                      </div>
                    </el-form-item>
                    <el-form-item label="微信号" prop="mail">
                      <div class="w220">
                        <el-input v-model="formData.contactWayOutVo.wechat" placeholder="请输入微信号"
                          :disabled="!isEdit.contactWayOutVo.edit"></el-input>
                      </div>
                    </el-form-item>
                    <el-form-item label="个人主页">
                      <div class="w220">
                        <el-input v-model="formData.contactWayOutVo.homepage" placeholder="请输入个人主页"
                          :disabled="!isEdit.contactWayOutVo.edit"></el-input>
                      </div>
                    </el-form-item>
                  </div>
                </div>
              </el-form>
              <el-form ref="form" :model="formData.jobIntentionOutVo" label-width="80px">
                <div class="resume-item-title d-flex">
                  <div class="flex-1">
                    <div class="title-text">求职意向</div>
                    <span class=title-border></span>
                  </div>
                  <div>
                    <el-button type="primary" v-if="!isEdit.jobIntentionOutVo.edit" @click="edit(3)">编辑</el-button>
                    <el-button type="primary" v-if="isEdit.jobIntentionOutVo.edit" @click="save(3)">保存</el-button>
                  </div>
                </div>
                <div class="d-flex">
                  <div class="resume-left flex-1">
                    <el-form-item label="目前状态" required>
                      <div class="w220">
                        <el-select v-model="formData.jobIntentionOutVo.currentStatus" placeholder="请选择目前状态"
                          style="width: 100%;" :disabled="!isEdit.jobIntentionOutVo.edit">
                          <el-option v-for="item in formData.currentStatus" :key="item.val" :label="item.name"
                            :value="item.val">
                          </el-option>
                        </el-select>
                      </div>
                    </el-form-item>
                    <el-form-item label="期望行业" required>
                      <div class="w220">
                        <el-select v-model="formData.jobIntentionOutVo.hopeTrade" placeholder="请选择期望行业"
                          style="width: 100%;" :disabled="!isEdit.jobIntentionOutVo.edit">
                          <el-option v-for="item in formData.hopeTrade" :key="item.val" :label="item.name"
                            :value="item.val">
                          </el-option>
                        </el-select>
                      </div>
                    </el-form-item>
                    <el-form-item label="工作方式" required>
                      <div class="w220">
                        <el-select v-model="formData.jobIntentionOutVo.workMode" placeholder="请选择工作方式"
                          style="width: 100%;" :disabled="!isEdit.jobIntentionOutVo.edit">
                          <el-option v-for="item in formData.workMode" :key="item.val" :label="item.name"
                            :value="item.val">
                          </el-option>
                        </el-select>
                      </div>
                    </el-form-item>
                    <el-form-item label="技能培训">
                      <div class="w220 l-h40">
                        <el-select v-model="formData.jobIntentionOutVo.needTrain" placeholder="请选择是否需要技能培训"
                          style="width: 100%;" :disabled="!isEdit.jobIntentionOutVo.edit">
                          <el-option key="1" label="是" value="1"></el-option>
                          <el-option key="0" label="否" value="0"></el-option>
                        </el-select>
                      </div>
                    </el-form-item>
                  </div>
                  <div class="resume-right flex-1">
                    <el-form-item label="期望职位" required>
                      <div class="w220">
                        <el-select v-model="formData.jobIntentionOutVo.hopeJob" placeholder="请选择期望职位"
                          style="width: 100%;" :disabled="!isEdit.jobIntentionOutVo.edit">
                          <el-option v-for="item in formData.workMode" :key="item.val" :label="item.name"
                            :value="item.val">
                          </el-option>
                        </el-select>
                      </div>
                    </el-form-item>
                    <el-form-item label="工作地点" required>
                      <div class="w220">
                        <el-select v-model="formData.jobIntentionOutVo.workPlace" placeholder="请选择工作地点"
                          style="width: 100%;" :disabled="!isEdit.jobIntentionOutVo.edit">
                          <el-option v-for="item in formData.workPlace" :key="item.val" :label="item.name"
                            :value="item.val">
                          </el-option>
                        </el-select>
                      </div>
                    </el-form-item>
                    <el-form-item label="期望薪资" required>
                      <div class="d-flex">
                        <div class="w220">
                          <el-input v-model="formData.jobIntentionOutVo.hopeWage" placeholder="请输入期望薪资"
                            :disabled="!isEdit.jobIntentionOutVo.edit"></el-input>
                        </div>
                        <span class="flex-1 ml10 c-555555 l-h40">元/月</span>
                      </div>
                    </el-form-item>
                  </div>
                </div>
              </el-form>
              <div>
                <div class="resume-item-title d-flex">
                  <div class="flex-1">
                    <div class="title-text">工作经历 <i class="el-icon-circle-plus-outline add-icon"
                        @click="addResume(1)"></i></div>
                    <span class=title-border></span>
                  </div>
                </div>
                <div class="add-btn" v-if="false" @click="addResume(1)"><i class="el-icon-circle-plus-outline add-icon"
                    style="margin-right: 10px;"></i>添加工作经历</div>
                <el-form ref="form" :model="item" label-width="80px" v-for="(item, index) in isEdit.resumeWork"
                  :key="index">
                  <div style="margin-bottom: 20px; margin-top: -35px;">
                    <div class="d-flex" style="margin-bottom: 20px;">
                      <div class="flex-1"></div>
                      <div>
                        <el-button plain @click="delResume(4, index)">删除</el-button>
                        <el-button type="primary" v-if="!item.edit" @click="edit(4, index, item)">编辑</el-button>
                        <el-button type="primary" v-if="item.edit" @click="save(4, index, item)">保存</el-button>
                      </div>
                    </div>
                    <div class="d-flex">
                      <div class="resume-left flex-1">
                        <el-form-item label="公司名称" required>
                          <div class="w220">
                            <el-input v-model="item.company" placeholder="请输入公司名称" :disabled="!item.edit"></el-input>
                          </div>
                        </el-form-item>
                        <el-form-item label="职位名称" required>
                          <div class="w220">
                            <el-input v-model="item.job" placeholder="请输入职位名称" :disabled="!item.edit"></el-input>
                          </div>
                        </el-form-item>
                        <el-form-item label="任职时间" required>
                          <div class="d-flex">
                            <div class="w220 d-flex picker-date">
                              <div style="width: 104; height: 100%; overflow: hidden; margin-right: 10px;">
                                <el-form-item prop="startTime" style="width: 100%; height: 100%;">
                                  <el-date-picker v-model="item.startTime" :disabled="!item.edit" type="date"
                                    :picker-options="startTimePicker" placeholder="时间">
                                  </el-date-picker>
                                </el-form-item>
                              </div>
                              <div style="width: 104; height: 100%; overflow: hidden;">
                                <el-form-item prop="endTime" style="width: 100%; height: 100%;">
                                  <el-date-picker v-model="item.endTime" type="date" :picker-options="endTimePicker"
                                    :disabled="item.toDay == 1 || !item.edit" placeholder="时间">
                                  </el-date-picker>
                                </el-form-item>
                              </div>
                            </div>
                            <div class="flex-1 ml10 l-h40">
                              <el-checkbox-group v-model="item.toDay">
                                <el-checkbox label="至今" name="type" :disabled="!item.edit"></el-checkbox>
                              </el-checkbox-group>
                            </div>
                          </div>
                        </el-form-item>
                      </div>
                      <div class="resume-right flex-1">
                        <el-form-item label="所属行业" required>
                          <div class="w220">
                            <el-select v-model="formData.jobIntentionOutVo.trade" placeholder="所属行业"
                              style="width: 100%;" :disabled="!item.edit">
                              <el-option v-for="item in formData.workMode" :key="item.val" :label="item.name"
                                :value="item.val">
                              </el-option>
                            </el-select>
                          </div>
                        </el-form-item>

                        <el-form-item label="职位类别" required>
                          <div class="w220">
                            <el-select v-model="item.jobCategory" placeholder="职位类别" style="width: 100%;"
                              :disabled="!item.edit">
                              <el-option v-for="item in formData.titleLevel" :key="item.val" :label="item.name"
                                :value="item.val">
                              </el-option>
                            </el-select>
                          </div>
                        </el-form-item>
                        <el-form-item label="税前月薪" required>
                          <div class="d-flex">
                            <div class="w220">
                              <el-input v-model="item.preTaxWage" placeholder="请输入税前月薪" :disabled="!item.edit">
                              </el-input>
                            </div>
                            <span class="flex-1 ml10 c-555555">元/月</span>
                          </div>

                        </el-form-item>
                      </div>
                    </div>
                    <el-form-item label="工作职责" required :disabled="!item.edit">
                      <div class="w590">
                        <el-input type="textarea" :disabled="!item.edit" :rows="10" placeholder="请输入工作职责"
                          v-model="item.remark">
                        </el-input>
                      </div>
                    </el-form-item>
                  </div>
                </el-form>
              </div>
              <div>
                <div class="resume-item-title d-flex">
                  <div class="flex-1">
                    <div class="title-text">教育经历 <i class="el-icon-circle-plus-outline add-icon"
                        @click="addResume(2)"></i></div>
                    <span class=title-border></span>
                  </div>
                </div>
                <div class="add-btn" v-if="false" @click="addResume(2)"><i class="el-icon-circle-plus-outline add-icon"
                    style="margin-right: 10px;"></i>添加教育经历</div>
                <el-form ref="form" :model="item" label-width="80px" v-for="(item, index) in isEdit.resumeEducation"
                  :key="index">
                  <div style="margin-bottom: 20px; margin-top: -35px;">
                    <div class="d-flex" style="margin-bottom: 20px;">
                      <div class="flex-1"></div>
                      <div>
                        <el-button plain @click="delResume(5, index)">删除</el-button>
                        <el-button type="primary" v-if="!isEdit.resumeEducation.edit" @click="edit(5, index, item)">编辑
                        </el-button>
                        <el-button type="primary" v-if="!isEdit.resumeEducation.edit" @click="save(5, index, item)">保存
                        </el-button>
                      </div>
                    </div>
                    <div class="d-flex">
                      <div class="resume-left flex-1">
                        <el-form-item label="毕业院校" required>
                          <div class="w220">
                            <el-input v-model="item.school" placeholder="请输入毕业院校"></el-input>
                          </div>
                        </el-form-item>
                        <el-form-item label="专业类别" required>
                          <div class="w220">
                            <el-select v-model="item.majorCategory" placeholder="请选择专业类别" style="width: 100%;">
                              <el-option key="bbk" label="汉族" value="bbk"></el-option>
                              <el-option key="xtc" label="少数民族" value="xtc"></el-option>
                            </el-select>
                          </div>
                        </el-form-item>
                        <el-form-item label="时间" required>
                          <div class="d-flex">
                            <div class="w220 d-flex picker-date">
                              <div style="width: 104; height: 100%; overflow: hidden; margin-right: 10px;">
                                <el-form-item prop="startTime" style="width: 100%; height: 100%;">
                                  <el-date-picker v-model="item.startTime" type="date" :picker-options="startTimePicker"
                                    placeholder="时间">
                                  </el-date-picker>
                                </el-form-item>
                              </div>
                              <div style="width: 104; height: 100%; overflow: hidden;">
                                <el-form-item prop="endTime" style="width: 100%; height: 100%;">
                                  <el-date-picker v-model="item.endTime" type="date" :picker-options="endTimePicker"
                                    :disabled="item.toDay == 1" placeholder="时间">
                                  </el-date-picker>
                                </el-form-item>
                              </div>
                            </div>
                            <div class="flex-1 ml10 l-h40">
                              <el-checkbox-group v-model="item.toDay">
                                <el-checkbox label="至今" name="type"></el-checkbox>
                              </el-checkbox-group>
                            </div>
                          </div>
                        </el-form-item>
                      </div>
                      <div class="resume-right flex-1">
                        <el-form-item label="学历" required>
                          <div class="w220">
                            <el-select v-model="item.education" placeholder="请选择学历" style="width: 100%;">
                              <el-option key="1" label="初中" value="1"></el-option>
                              <el-option key="2" label="高中" value="2"></el-option>
                              <el-option key="3" label="中技" value="3"></el-option>
                              <el-option key="4" label="中专" value="4"></el-option>
                              <el-option key="5" label="大专" value="5"></el-option>
                              <el-option key="6" label="本科" value="6"></el-option>
                              <el-option key="7" label="硕士" value="7"></el-option>
                              <el-option key="8" label="博士" value="8"></el-option>
                              <el-option key="9" label="博后" value="9"></el-option>
                            </el-select>
                          </div>
                        </el-form-item>
                        <el-form-item label="所学专业" required>
                          <div class="w220">
                            <el-select v-model="item.major" placeholder="请选择所学专业" style="width: 100%;">
                              <el-option key="bbk" label="汉族" value="bbk"></el-option>
                              <el-option key="xtc" label="少数民族" value="xtc"></el-option>
                            </el-select>
                          </div>
                        </el-form-item>
                      </div>
                    </div>
                  </div>
                </el-form>
              </div>
              <div>
                <div class="resume-item-title d-flex">
                  <div class="flex-1">
                    <div class="title-text">语言能力 <i class="el-icon-circle-plus-outline add-icon"></i></div>
                    <span class=title-border></span>
                  </div>
                </div>
                <div class="add-btn" v-if="false" @click="addResume(3)"><i class="el-icon-circle-plus-outline add-icon"
                    style="margin-right: 10px;"></i>语言能力</div>
                <el-form ref="form" :model="item" label-width="80px" v-for="(item, index) in isEdit.resumeLanguage"
                  :key="index">
                  <div style="margin-bottom: 20px; margin-top: -35px;">
                    <div class="d-flex" style="margin-bottom: 20px;">
                      <div class="flex-1"></div>
                      <div>
                        <el-button plain @click="delResume(6, index)">删除</el-button>
                        <el-button type="primary" @click="edit(6, index)">编辑</el-button>
                        <el-button type="primary" @click="save(6, index)">保存</el-button>
                      </div>
                    </div>
                    <div class="d-flex">
                      <div class="resume-left flex-1">
                        <el-form-item label="语言" required>
                          <div class="w220">
                            <el-select v-model="item.language" placeholder="请选择语言" style="width: 100%;">
                              <el-option key="1" label="初中" value="1"></el-option>
                              <el-option key="2" label="高中" value="2"></el-option>
                            </el-select>
                          </div>
                        </el-form-item>
                      </div>
                      <div class="resume-right flex-1">
                        <el-form-item label="熟练程度" required>
                          <div class="w220">
                            <el-select v-model="item.proficiency" placeholder="请选择熟练程度" style="width: 100%;">
                              <el-option key="1" label="初中" value="1"></el-option>
                              <el-option key="2" label="高中" value="2"></el-option>
                            </el-select>
                          </div>
                        </el-form-item>
                      </div>
                    </div>

                  </div>
                </el-form>
              </div>
              <div>
                <div class="resume-item-title d-flex">
                  <div class="flex-1">
                    <div class="title-text">学习经历 <i class="el-icon-circle-plus-outline add-icon"
                        @click="addResume(4)"></i></div>
                    <span class=title-border></span>
                  </div>
                </div>
                <div class="add-btn" v-if="false" @click="addResume(4)"><i class="el-icon-circle-plus-outline add-icon"
                    style="margin-right: 10px;"></i>学习经历</div>
                <el-form ref="form" :model="item" label-width="80px" v-for="(item, index) in isEdit.resumeTrain"
                  :key="index">
                  <div style="margin-bottom: 20px;">
                    <div class="d-flex" style="margin-bottom: 20px;">
                      <div class="flex-1"></div>
                      <div>
                        <el-button plain @click="delResume(7, index)">删除</el-button>
                        <el-button type="primary" @click="edit(7, index)">编辑</el-button>
                        <el-button type="primary" @click="save(7, index)">保存</el-button>
                      </div>
                    </div>
                    <div class="d-flex">
                      <div class="resume-left flex-1">
                        <el-form-item label="培训机构" required>
                          <div class="w220">
                            <el-input v-model="item.institution" placeholder="请输入培训机构"></el-input>
                          </div>
                        </el-form-item>
                        <el-form-item label="培训时间" required>
                          <div class="d-flex">
                            <div class="w220 d-flex picker-date">
                              <div style="width: 104; height: 100%; overflow: hidden; margin-right: 10px;">
                                <el-form-item prop="startTime" style="width: 100%; height: 100%;">
                                  <el-date-picker v-model="item.startTime" type="date" :picker-options="startTimePicker"
                                    placeholder="时间">
                                  </el-date-picker>
                                </el-form-item>
                              </div>
                              <div style="width: 104; height: 100%; overflow: hidden;">
                                <el-form-item prop="endTime" style="width: 100%; height: 100%;">
                                  <el-date-picker v-model="item.endTime" type="date" :picker-options="endTimePicker"
                                    :disabled="item.toDay == 1" placeholder="时间">
                                  </el-date-picker>
                                </el-form-item>
                              </div>
                            </div>
                            <div class="flex-1 ml10">
                              <el-checkbox-group v-model="item.toDay">
                                <el-checkbox label="至今" name="type"></el-checkbox>
                              </el-checkbox-group>
                            </div>
                          </div>
                        </el-form-item>
                      </div>
                      <div class="resume-right flex-1">
                        <el-form-item label="培训课程" required>
                          <div class="w220">
                            <el-input v-model="item.course" placeholder="请输入培训课程"></el-input>
                          </div>
                        </el-form-item>
                      </div>
                    </div>
                    <el-form-item label="培训内容">
                      <div class="w590">
                        <el-input type="textarea" :rows="10" placeholder="请输入培训内容" v-model="item.content">
                        </el-input>
                      </div>
                    </el-form-item>
                  </div>
                </el-form>
              </div>
              <div>
                <div class="resume-item-title d-flex">
                  <div class="flex-1">
                    <div class="title-text">自我介绍</div>
                    <span class=title-border></span>
                  </div>
                </div>
                <div class="fs14 h40">技能及特长<i class="el-icon-circle-plus-outline add-icon" @click="addResume(5)"></i>
                </div>
                <el-form ref="form" :model="item" label-width="80px" v-for="(item, index) in isEdit.resumeSkill"
                  :key="index">
                  <div class="d-flex" style="margin-bottom: 20px;">
                    <div class="flex-1"></div>
                    <div>
                      <el-button plain @click="delResume(8, index)">删除</el-button>
                      <el-button type="primary" @click="edit(8, index)">编辑</el-button>
                      <el-button type="primary" @click="save(8, index)">保存</el-button>
                    </div>
                  </div>
                  <div class="d-flex">
                    <div class="resume-left flex-1">
                      <el-form-item label="技能名称" required>
                        <div class="w220">
                          <el-input v-model="item.name" placeholder="请输入技能名称"></el-input>
                        </div>
                      </el-form-item>
                    </div>
                    <div class="resume-right flex-1">
                      <el-form-item label="使用时长" required>
                        <div class="d-flex">
                          <div class="w220">
                            <el-input v-model="item.useDuration" placeholder="请输入使用时长"></el-input>
                          </div>
                          <span class="flex-1 ml10 c-555555">月</span>
                        </div>
                      </el-form-item>
                    </div>
                  </div>
                </el-form>
              </div>
              <div class="fs14 h40">成果及获奖情况<i class="el-icon-circle-plus-outline add-icon" @click="addResume(6)"></i>
              </div>
              <el-form ref="form" :model="item" label-width="80px" v-for="(item, index) in isEdit.resumeAward"
                :key="index">
                <div class="d-flex" style="margin-bottom: 20px;">
                  <div class="flex-1"></div>
                  <div>
                    <el-button plain @click="delResume(9, index)">删除</el-button>
                    <el-button type="primary" @click="edit(9, index)">编辑</el-button>
                    <el-button type="primary" @click="save(9, index)">保存</el-button>
                  </div>
                </div>
                <div class="d-flex">
                  <div class="resume-left flex-1">
                    <el-form-item label="奖项名称" required>
                      <div class="w220">
                        <el-input v-model="item.name" placeholder="请输入奖项名称"></el-input>
                      </div>
                    </el-form-item>
                  </div>
                  <div class="resume-right flex-1" required>
                    <el-form-item label="获得时间">
                      <div class="w220">
                        <el-date-picker type="date" placeholder="请选择获得时间" v-model="item.gainTime" value-format="yyyy-MM"
                          style="width: 100%;"></el-date-picker>
                      </div>
                    </el-form-item>
                  </div>
                </div>
              </el-form>
              <el-form ref="form" :model="formData.resumeOutVo" label-width="80px">
                <el-form-item label="兴趣爱好">
                  <div class="w590">
                    <el-input type="textarea" :rows="10" placeholder="请输入兴趣爱好" v-model="formData.resumeOutVo.interest">
                    </el-input>
                  </div>
                </el-form-item>
                <el-form-item label="自我评价">
                  <div class="w590">
                    <el-input type="textarea" :rows="10" placeholder="请输入自我评价"
                      v-model="formData.resumeOutVo.evaluation">
                    </el-input>
                  </div>
                </el-form-item>
              </el-form>
            </div>
          </el-tab-pane>
          <el-tab-pane :label="`第一份简历`" name="two">
            <el-form ref="form" :model="form" label-width="80px">

            </el-form>
          </el-tab-pane>
          <el-tab-pane :label="`新增简历`" name="3">
            <el-form ref="form" :model="form" label-width="80px">

            </el-form>
          </el-tab-pane>
        </el-tabs>
      </div>
    </div>
  </div>
</template>

<script>
import { selectResume, insertResume, insertTrain, insertEducation, insertLanguage, insertSkill, insertWork, deleteWork, deleteEducation, deleteLanguage, deleteSkill, deleteTrain, deleteResumeAward } from '../../../api/index';
export default {
  name: 'baseform',
  data () {
    return {
      // 出生日期 限制可选时间段
      pickerOptions0: {
        disabledDate (time) {
          let curDate = (new Date()).getTime();
          let disBeforDate = 16 * 12 * 30 * 24 * 3600 * 1000;
          let beforMonths = curDate - disBeforDate;
          return time.getTime() > Date.now() || time.getTime() < beforMonths;
        }
      },
      pickerOptions: {
        disabledDate (time) {
          return time.getTime() > Date.now();
        }
      },
      // start 开始时间小于今天,结束时间不能大于开始时间
      startTimePicker: {
        disabledDate: time => {
          if (this.formData.resumeWork.endTime) {
            return (
              time.getTime() > new Date(this.formData.resumeWork.endTime).getTime()
            );
          } else {
            return time.getTime() > Date.now();
          }
        }
      },
      endTimePicker: {
        disabledDate: time => {
          if (this.formData.resumeWork.startTime) {
            return (
              time.getTime() > Date.now() ||
              time.getTime() < new Date(this.formData.resumeWork.startTime).getTime()
            );
          } else {
            return time.getTime() > Date.now();
          }
        }
      },
      currents: 1,
      resume: 'first',
      leftSideBar: ['基本信息', '联系信息', '求职意向', '工作经历', '教育经历', '语言能力', '学习经历', '自我介绍'],
      // formData: {},
      formData: {
        //技能及特长表
        resumeSkill: [{
          /**
           * 技能名称
           */
          name: '',
          /**
           * 使用时长
           */
          useDuration: ''
        }, {
          /**
           * 技能名称
           */
          name: '',
          /**
           * 使用时长
           */
          useDuration: ''
        }],
        //学习经历表
        resumeTrain: [{
          /**
           * 机构
           */
          institution: '',

          /**
           * 课程
           */
          course: '',

          /**
          * 培训开始时间
          */
          startTime: '',

          /**
          * 培训结束时间
          */
          endTime: '',

          /**
          * 是否至今：1:true是，0:false否
          */

          toDay: '',

          /**
          * 培训内容
          */
          content: '',

        }, {
          /**
           * 机构
           */
          institution: '',

          /**
           * 课程
           */
          course: '',

          /**
          * 培训开始时间
          */
          startTime: '',

          /**
          * 培训结束时间
          */
          endTime: '',

          /**
          * 是否至今：1:true是，0:false否
          */

          toDay: '',

          /**
          * 培训内容
          */
          content: '',

        }],
        // 工作经历
        resumeWork: [{
          /**
           * 公司名称
           */
          company: '',

          /**
           * 所属行业
           */
          trade: '',

          /**
           * 职位名称
           */
          job: '',

          /**
           * 职位类别
           */
          jobCategory: '',

          /**
           * 税前薪资
           */
          preTaxWage: '',

          /**
           * 工作开始时间
           */
          startTime: '',

          /**
           * 工作结束时间
           */
          endTime: '',

          /**
           * 是否至今：1：true是，0：false否
           */
          toDay: '',
          /**
           * 替补 是否至今：1:true是，0:false否
           */
          substitutionToDay: '',

          /**
           * 目前状态
           */
          currentStatus: '',

          /**
           * 期望职位
           */
          hopeJob: '',

          /**
           * 期望行业
           */
          hopeTrade: '',

          /**
           * 工作地点
           */
          workPlace: '',

          /**
           * 工作方式
           */
          workMode: '',

          /**
           * 期望薪资
           */
          hopeWage: '',
          // 工作职责
          remark: ''

        }],
        // 联系信息
        contactWayOutVo: {

          /**
           * 手机号码
           */
          phone: '',
          /**
           * 电子邮箱
           */
          mail: '',
          /**
           * qq
           */
          qq: '',
          /**
           * 微信
           */
          wechat: '',
          /**
           * 通信地址
           */
          mailingAddress: '',
          /**
           * 个人主页
           */
          homepage: '',
        },
        // 求职意向
        jobIntentionOutVo: {

          /**
           * 目前状态
           */
          currentStatus: '',

          /**
           * 期望职位
           */
          hopeJob: '',

          /**
           * 期望行业
           */
          hopeTrade: '',

          /**
           * 工作地点
           */
          workPlace: '',

          /**
           * 工作方式
           */
          workMode: '',

          /**
           * 期望薪资
           */
          hopeWage: '',

          /**
           * 是否需要技能培训
           */
          needTrain: '',
        },
        // 成果级获奖表
        resumeAward: [{

          /**
          * 奖项名称
          */
          name: '',

          /**
          * 获得时间
          */
          gainTime: '',

        }, {

          /**
          * 奖项名称
          */
          name: '',

          /**
          * 获得时间
          */
          gainTime: '',

        }],
        // 教育经历表 
        resumeEducation: [{

          /**
           * 毕业院校
           */
          school: '',

          /**
           * 学历
           */
          education: '',

          /**
           * 专业类别
           */
          majorCategory: '',

          /**
           * 所学专业
           */
          major: '',

          /**
           * 开始时间
           */
          startTime: '',

          /**
           * 结束时间
           */
          endTime: '',

          /**
           * 是否至今：1:true是，0:false否
           */

          toDay: '',

          /**
           * 替补 是否至今：1:true是，0:false否
           */
          substitutionToDay: ''

        }, {

          /**
           * 毕业院校
           */
          school: '',

          /**
           * 学历
           */
          education: '',

          /**
           * 专业类别
           */
          majorCategory: '',

          /**
           * 所学专业
           */
          major: '',

          /**
           * 开始时间
           */
          startTime: '',

          /**
           * 结束时间
           */
          endTime: '',

          /**
           * 是否至今：1:true是，0:false否
           */

          toDay: '',

          /**
           * 替补 是否至今：1:true是，0:false否
           */
          substitutionToDay: ''

        }],
        // 语言能力表
        resumeLanguage: [{
          /**
          * 语言
          */
          language: '',

          /**
          * 熟练程度
          */
          proficiency: '',


        }, {
          /**
          * 语言
          */
          language: '',

          /**
          * 熟练程度
          */
          proficiency: '',


        }],
        // 简历信息表
        resumeOutVo: {
          /**
          * 个人用户id
          */
          userId: '',

          /**
          * 姓名
          */
          name: '',

          /**
          * 身份证号
          */
          idCard: '',

          /**
          * 出生日期
          */
          birthday: '',

          /**
          * 性别
          */
          sex: '',

          /**
          * 照片
          */
          photo: '',

          /**
          * 民族
          */
          nation: '',

          /**
          * 婚姻状况
          */
          maritalStatus: '',

          /**
          * 政治面貌
          */
          politicalStatus: '',

          /**
          * 户籍所在地
          */
          domicilePlace: '',

          /**
          * 现居住地
          */
          currentResidence: '',

          /**
          * 身高
          */
          height: '',

          /**
          * 体重
          */
          weight: '',

          /**
          * 视力
          */
          vision: '',

          /**
          * 职称级别
          */
          titleLevel: '',

          /**
          * 工作经验
          */
          workExp: '',

          /**
          * 参加工作时间
          */
          workTime: '',

          /**
          * 是否暂无工作经历 1：true是，0:false无
          */

          notWorkExp: '',

          /**
          * 替补 是否暂无工作经历 1：true是，0:false无
          */
          substitutionWorkExp: '',

          /**
          * 学历
          */
          education: '',

          /**
          * 专业
          */
          major: '',

          /**
          * 手机号码
          */
          phone: '',

          /**
          * 电子邮箱
          */
          mail: '',

          /**
          * qq
          */
          qq: '',

          /**
          * 微信
          */
          wechat: '',

          /**
          * 通信地址
          */
          mailingAddress: '',

          /**
          * 个人主页
          */
          homepage: '',

          /**
          * 目前状态
          */
          currentStatus: '',

          /**
          * 期望职位
          */
          hopeJob: '',

          /**
          * 期望行业
          */
          hopeTrade: '',

          /**
          * 工作地点
          */
          workPlace: '',

          /**
          * 工作方式
          */
          workMode: '',

          /**
          * 期望薪资
          */
          hopeWage: '',

          /**
          * 是否需要技能培训
          */
          needTrain: '',

          /**
          * 兴趣爱好
          */
          interest: '',

          /**
          * 自我评价
          */
          evaluation: '',

          /**
          * 完整度
          */
          integrity: '',

          /**
          * 公开程度：1.对所有公开，2.完全保密
          */
          publicity: '',

          /**
          * 刷新时间
          */
          refreshTime: '',

          /**
          * 到期时间
          */
          expireTime: '',

          /**
          * 审核状态：0.待审核，1.通过，2.未通过
          */
          auditStatus: '',

          /**
          * 照片审核状态：0.待审核，1.通过，2.未通过
          */
          photoAuditStatus: '',
        }
      },
      isEdit: {
        //技能及特长表
        resumeSkill: [{
          /**
           * 技能名称
           */
          name: '',
          /**
           * 使用时长
           */
          useDuration: ''
        }
        ],
        //学习经历表
        resumeTrain: [{
          /**
           * 机构
           */
          institution: '',

          /**
           * 课程
           */
          course: '',

          /**
          * 培训开始时间
          */
          startTime: '',

          /**
          * 培训结束时间
          */
          endTime: '',

          /**
          * 是否至今：1:true是，0:false否
          */

          toDay: '',

          /**
          * 培训内容
          */
          content: '',

        }],
        // 工作经历
        resumeWork: [{
          /**
           * 公司名称
           */
          company: '',

          /**
           * 所属行业
           */
          trade: '',

          /**
           * 职位名称
           */
          job: '',

          /**
           * 职位类别
           */
          jobCategory: '',

          /**
           * 税前薪资
           */
          preTaxWage: '',

          /**
           * 工作开始时间
           */
          startTime: '',

          /**
           * 工作结束时间
           */
          endTime: '',

          /**
           * 是否至今：1：true是，0：false否
           */
          toDay: '',
          /**
           * 替补 是否至今：1:true是，0:false否
           */
          substitutionToDay: '',

          /**
           * 目前状态
           */
          currentStatus: '',

          /**
           * 期望职位
           */
          hopeJob: '',

          /**
           * 期望行业
           */
          hopeTrade: '',

          /**
           * 工作地点
           */
          workPlace: '',

          /**
           * 工作方式
           */
          workMode: '',

          /**
           * 期望薪资
           */
          hopeWage: '',
          // 工作职责
          remark: ''

        }, {
          /**
           * 公司名称
           */
          company: '',

          /**
           * 所属行业
           */
          trade: '',

          /**
           * 职位名称
           */
          job: '',

          /**
           * 职位类别
           */
          jobCategory: '',

          /**
           * 税前薪资
           */
          preTaxWage: '',

          /**
           * 工作开始时间
           */
          startTime: '',

          /**
           * 工作结束时间
           */
          endTime: '',

          /**
           * 是否至今：1：true是，0：false否
           */
          toDay: '',
          /**
           * 替补 是否至今：1:true是，0:false否
           */
          substitutionToDay: '',

          /**
           * 目前状态
           */
          currentStatus: '',

          /**
           * 期望职位
           */
          hopeJob: '',

          /**
           * 期望行业
           */
          hopeTrade: '',

          /**
           * 工作地点
           */
          workPlace: '',

          /**
           * 工作方式
           */
          workMode: '',

          /**
           * 期望薪资
           */
          hopeWage: '',
          // 工作职责
          remark: ''

        }],
        // 成果级获奖表
        resumeAward: [{

          /**
          * 奖项名称
          */
          name: '',

          /**
          * 获得时间
          */
          gainTime: '',

        }],
        // 教育经历表 
        resumeEducation: [{

          /**
           * 毕业院校
           */
          school: '',

          /**
           * 学历
           */
          education: '',

          /**
           * 专业类别
           */
          majorCategory: '',

          /**
           * 所学专业
           */
          major: '',

          /**
           * 开始时间
           */
          startTime: '',

          /**
           * 结束时间
           */
          endTime: '',

          /**
           * 是否至今：1:true是，0:false否
           */

          toDay: '',

          /**
           * 替补 是否至今：1:true是，0:false否
           */
          substitutionToDay: ''

        }],
        // 语言能力表
        resumeLanguage: [
          {
            /**
            * 语言
            */
            language: '',

            /**
            * 熟练程度
            */
            proficiency: '',


          }, {
            /**
            * 语言
            */
            language: '',

            /**
            * 熟练程度
            */
            proficiency: '',


          }],
        // 联系信息
        contactWayOutVo: {
          edit: false
        },
        // 求职意向
        jobIntentionOutVo: {
          edit: false
        },
        // 简历信息表
        resumeOutVo: {
          edit: true
        }
      },
      resumeOutVoRules: {
        name: [{ required: true, message: '请输入姓名', trigger: 'blur' }],
        birthday: [{ required: true, message: '请选择日期', trigger: 'blur' }],
        sex: [{ required: true, message: '请选择性别', trigger: 'blur' }],
        workTime: [{ required: true, message: '请选择日期', trigger: 'blur' }],
        education: [{ required: true, message: '请选择学历', trigger: 'blur' }],
        workExp: [{ required: true, message: '请输入所学专业', trigger: 'blur' }],
        idCard: [
          { required: false, message: '请输入证件号码', trigger: 'blur' },
          {
            pattern: /^([\u4E00-\u9FA5](字第)([0-9a-zA-Z]{4,8})(号?))|([1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}(\d|x|X))|([1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}(\d|x|X))$/,
            message: '请输入正确的证件号'
          }
        ]
      },
      contactWayOutVo: {
        mail: [
          { required: false, message: '请输入邮箱', trigger: 'blur' },
          {
            pattern: /^[A-Za-z0-9]+([_\.][A-Za-z0-9]+)*@([A-Za-z0-9\-]+\.)+[A-Za-z]{2,6}$/,
            message: '请输入正确的邮箱',
            trigger: 'change'
          },
          { max: 20, message: '邮箱不能超过20个字' }
        ],
        phone: [
          { required: false, message: '请输入手机号', trigger: 'blur' },
          { pattern: /^1[3456789]\d{9}$/, message: '请输入正确的手机号码', trigger: 'change' }
        ],
        wechat: [
          { validator: this.checkData, trigger: 'change' }
        ]
      },
      ajaxSuccess: false,
      rules: {
        name: [{ required: true, message: '请输入姓名', trigger: 'blur' }],
        birthday: [{ required: true, message: '请选择日期', trigger: 'blur' }],
        workTime: [{ required: true, message: '请选择日期', trigger: 'blur' }],
        mail: [{ validator: this.checkEmail, trigger: 'change' }],
        school: [{ required: true, message: '请输入学校名称', trigger: 'blur' }],
        education: [{ required: true, message: '请选择学历', trigger: 'change' }],
        majorCategory: [{ required: true, message: '请输入所学专业', trigger: 'blur' }],
        startendTime: [{ required: true, message: '请选择日期', trigger: 'blur' }],
        company: [{ required: true, message: '请输入公司名称', trigger: 'blur' }],
        trade: [{ required: true, message: '请选择所属行业', trigger: 'blur' }],
        job: [{ required: true, message: '请职位名称', trigger: 'blur' }],
        startTime: [{ required: true, message: '开始时间', trigger: 'blur' }],
        endTime: [{ required: true, message: '结束时间', trigger: 'change' }],
        remark: [{ required: true, message: '请输入工作描述', trigger: 'blur' }],
        currentStatus: [{ required: true, message: '请选择求职状态', trigger: 'change' }],
        workPlace: [{ required: true, message: '请选择期望地点', trigger: 'blur' }],
        hopeWage: [{ required: true, message: '请输入税前月薪', trigger: 'blur' }]
      },
      form: {},
      options: [
        {
          value: 'guangdong',
          label: '广东省',
          children: [
            {
              value: 'guangzhou',
              label: '广州市',
              children: [
                {
                  value: 'tianhe',
                  label: '天河区'
                },
                {
                  value: 'haizhu',
                  label: '海珠区'
                }
              ]
            },
            {
              value: 'dongguan',
              label: '东莞市'
            }
          ]
        },
        {
          value: 'hunan',
          label: '湖南省',
          children: [
            {
              value: 'changsha',
              label: '长沙市',
              children: [
                {
                  value: 'yuelu',
                  label: '岳麓区'
                }
              ]
            }
          ]
        }
      ]
    };
  },
  mounted () {
    this.getResume();
  },
  methods: {
    deleteWork (id, index) {
      let param = {};
      param.id = id;
      deleteWork(param).then(res => {
        if (res.code == 200) {
          this.formData.resumeWork.splice(index, 1);
        }
      });
    },
    deleteEducation (id, index) {
      let param = {};
      param.id = id;
      deleteEducation(param).then(res => {
        if (res.code == 200) {
          this.formData.resumeEducation.splice(index, 1);
        }
      });
    },
    deleteLanguage (id, index) {
      let param = {};
      param.id = id;
      deleteLanguage(param).then(res => {
        if (res.code == 200) {
          this.formData.resumeLanguage.splice(index, 1);
        }
      });
    },
    deleteSkill (id, index) {
      let param = {};
      param.id = id;
      deleteSkill(param).then(res => {
        if (res.code == 200) {
          this.formData.resumeTrain.splice(index, 1);
        }
      });
    },
    deleteTrain (id, index) {
      let param = {};
      param.id = id;
      deleteTrain(param).then(res => {
        if (res.code == 200) {
          this.formData.resumeSkill.splice(index, 1);
        }
      });
    },
    deleteResumeAward (id, index) {
      let param = {};
      param.id = id;
      deleteResumeAward(param).then(res => {
        if (res.code == 200) {
          this.formData.resumeAward.splice(index, 1);
        }
      });
    },
    getResume () {
      let param = {};
      param.id = '871547978e6240d2bb6f949f6e117876';
      selectResume(param).then(res => {
        if (res.code == 200) {
          // this.formData = res.data;
          // this.isEdit.resumeSkill = res.data.resumeSkill;
          // this.isEdit.resumeTrain = res.data.resumeTrain;
          // this.isEdit.resumeWork = res.data.resumeWork;
          // this.isEdit.resumeAward = res.data.resumeAward;
          // this.isEdit.resumeEducation = res.data.resumeEducation;
          // this.isEdit.resumeLanguage = res.data.resumeLanguage;
          this.isEdit.resumeSkill.forEach(item => {
            item.edit = false;
          });
          this.isEdit.resumeSkill.forEach(item => {
            item.edit = false;
          });
          this.isEdit.resumeTrain.forEach(item => {
            item.edit = false;
          });
          this.isEdit.resumeWork.forEach(item => {
            item.edit = false;
          });
          this.isEdit.resumeAward.forEach(item => {
            item.edit = false;
          });
          this.isEdit.resumeEducation.forEach(item => {
            item.edit = false;
          });
          this.isEdit.resumeLanguage.forEach(item => {
            item.edit = false;
          });
        }
      });
    },
    insertResume (param) {
      insertResume(param).then(res => {
        if (res.code == 200) {
          // this.formData = res.data;
          this.ajaxSuccess = true;
        }
      });
    },
    // 学习经历表
    insertTrain (param) {
      insertTrain(param).then(res => {
        if (res.code == 200) {
          this.formData = res.data;
        }
      });
    },
    // 保存工作经历
    insertEducation (param) {
      insertEducation(param).then(res => {
        if (res.code == 200) {
          this.formData = res.data;
        }
      });
    },
    // 语言能力表
    insertLanguage (param) {
      insertLanguage(param).then(res => {
        if (res.code == 200) {
          this.formData = res.data;
        }
      });
    },
    // 技能及特长表
    insertSkill (param) {
      insertSkill(param).then(res => {
        if (res.code == 200) {
          this.formData = res.data;
        }
      });
    },
    // insertWork
    insertWork (param) {
      insertWork(param).then(res => {
        if (res.code == 200) {
          this.formData = res.data;
        }
      });
    },
    // insertResumeAward
    insertResumeAward (param) {
      insertWork(param).then(res => {
        if (res.code == 200) {
          this.formData = res.data;
        }
      });
    },
    // del
    deleteById (param) {
      deleteById(param).then(res => {
        if (res.code == 200) {
          this.$message({
            type: 'success',
            message: '删除成功!'
          });
          // this.formData = res.data;
        }
      });
    },
    checkData (rule, value, callback) {
      if (value) {
        if (/[\u4E00-\u9FA5]/g.test(value)) {
          callback(new Error('不能输入中文!'));
        } else {
          callback();
        }
      }
    },
    edit (type, index, item) {
      switch (type) {
        case 1:
          this.isEdit.resumeOutVo.edit = !this.isEdit.resumeOutVo.edit;
          break;
        case 2:
          this.isEdit.contactWayOutVo.edit = !this.isEdit.contactWayOutVo.edit;
          break;
        case 3:
          this.isEdit.jobIntentionOutVo.edit = !this.isEdit.jobIntentionOutVo.edit;
          break;
        case 4:
        case 5:
        case 6:
        case 7:
        case 8:
        case 9:
          this.isEdit.resumeWork[index].edit = true;
          this.isEdit.resumeWork.splice(index, 1, this.isEdit.resumeWork[index]);
          console.log(this.isEdit.resumeWork);
          break;
        default:
      }
    },
    save (type, index) {
      let refs;
      switch (type) {
        case 1:
          refs = 'resumeOutVo';
          this.isEdit.resumeOutVo.edit = !this.isEdit.resumeOutVo.edit;
          break;
        case 2:
          refs = 'contactWayOutVo';
          this.insertResume(this.formData.contactWayOutVo);
          this.isEdit.contactWayOutVo.edit = !this.isEdit.resumeEducation.edit;
          return false;
          break;
        case 3:
          refs = 'jobIntentionOutVo';
          this.insertResume(this.formData.jobIntentionOutVo);
          this.isEdit.jobIntentionOutVo.edit = !this.isEdit.jobIntentionOutVo.edit;
          return false;
          break;
        case 4:
          refs = 'resumeWork';
          let arr = [];
          arr.push(this.formData.resumeWork[index]);
          this.insertWork(arr);
          return false;
          break;
        case 5:
          refs = 'resumeEducation';
          this.insertEducation(this.formData.resumeEducation[index]);
          this.isEdit.resumeEducation.edit = !this.isEdit.resumeEducation.edit;
          return false;
          break;
        case 6:
          refs = 'resumeLanguage';
          this.insertLanguage(this.formData.resumeLanguage[index]);
          return false;
          break;
        case 7:
          refs = 'resumeTrain';
          this.insertTrain(this.formData.resumeTrain[index]);
          return false;
          break;
        case 8:
          refs = 'resumeSkill';
          this.insertSkill(this.formData.resumeSkill[index]);
          return false;
          break;
        case 9:
          refs = 'resumeAward';
          this.insertResumeAward(this.formData.resumeAward[index]);
          return false;
          break;
        default:
      }
      this.$refs[refs].validate(valid => {
        if (valid) {
          let dataParams = {};
          switch (type) {
            case 1:
              // dataParams.name = '11';
              console.log(this.formData.resumeOutVo);
              this.insertResume(this.formData.resumeOutVo);
              break;
            case 3:
              this.insertResume(this.formData.jobIntentionOutVo);
              break;
            default:
          }
        }
      });
    },
    // 身份证校验
    idCard () {
      var regIdNo = /(^\d{}$)|(^\d{}$)|(^\d{}(\d|X|x)$)/;
      if (!regIdNo.test(idNo)) {
        alert('身份证号填写有误');
        return false;
      }
    },

    toScroll (index) {
      this.currents = index
      // 用 class="scroll_title" 添加锚点
      let jump = document.querySelectorAll(".resume-item-title")
      let scroll_content = document.querySelector(".container-right")
      let total = jump[index - 1].offsetTop + 55  //这里的5是上面tab的高度
      let distance = scroll_content.scrollTop   //获取需要滚动的距离
      // 平滑滚动，时长500ms，每10ms一跳，共50跳
      let step = total / 50
      if (total > distance) {
        smoothDown()
      } else {
        let newTotal = distance - total
        step = newTotal / 50
        smoothUp()
      }
      function smoothDown () {
        if (distance < total) {
          distance += step
          scroll_content.scrollTop = distance
          setTimeout(smoothDown, 10)
        } else {
          scroll_content.scrollTop = total
        }
      }
      function smoothUp () {
        if (distance > total) {
          distance -= step
          scroll_content.scrollTop = distance
          setTimeout(smoothUp, 10)
        } else {
          scroll_content.scrollTop = total
        }
      }
    },
    // 新增 每一模块
    addResume (type) {
      // type : 1增加工作经历  2教育经历  3语言能力 4学习经历 5技能及特长 6成果及获奖情况
      switch (type) {
        case 1:
          break;
        case 2:
          break;
        case 3:
          break;
        case 4:
          break;
        case 5:
          break;
        case 6:
          break;
        default:
      }
    },
    // 删除每一模块
    delResume (type, index) {
      this.$confirm('确定删除吗？', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        switch (type) {
          case 4:
            if (this.formData.resumeWork[index].id) {
              this.deleteWork(this.formData.resumeWork[index].id, index);
            } else {
              this.formData.resumeWork.splice(index, 1);
            }
            break;
          case 5:
            if (this.formData.resumeEducation[index].id) {
              this.deleteEducation(this.formData.resumeEducation[index].id, index);
            } else {
              this.formData.resumeEducation.splice(index, 1);
            }
            // this.insertEducation(this.formData.resumeEducation[index]);
            break;
          case 6:
            if (this.formData.resumeLanguage[index].id) {
              this.deleteLanguage(this.formData.resumeLanguage[index].id, index);
            } else {
              this.formData.resumeLanguage.splice(index, 1);
            }
            // this.insertLanguage(this.formData.resumeLanguage[index]);
            break;
          case 7:
            if (this.formData.resumeTrain[index].id) {
              this.deleteSkill(this.formData.resumeTrain[index].id, index);
            } else {
              this.formData.resumeTrain.splice(index, 1);
            }
            // this.insertTrain(this.formData.resumeTrain[index]);
            break;
          case 8:
            if (this.formData.resumeSkill[index].id) {
              this.deleteTrain(this.formData.resumeSkill[index].id, index);
            } else {
              this.formData.resumeSkill.splice(index, 1);
            }
            // this.insertSkill(this.formData.resumeSkill[index].id);
            break;
          case 9:
            if (this.formData.resumeAward[index].id) {
              this.deleteResumeAward(this.formData.resumeAward[index].id, index);
            } else {
              this.formData.resumeAward.splice(index, 1);
            }
            // this.insertResumeAward(this.formData.resumeAward[index].id);
            break;
          default:
        }
      });

    },
    editResume (type) {
      // type : 1增加工作经历  2教育经历  3语言能力 4学习经历 5技能及特长 6成果及获奖情况
      switch (type) {
        case 1:
          break;
        case 2:
          break;
        case 3:
          break;
        case 4:
          break;
        case 5:
          break;
        case 6:
          break;
        default:
      }
    }
  }
};
</script>
<style scoped>
.container {
    width: 1200px;
    background: #f7f3f3;
    margin: 0 auto;
    height: 100%;
    box-sizing: border-box;
}
.container-left {
    background: #fff;
    width: 230px;
    margin-right: 30px;
    padding: 30px;
}
.container-right {
    padding: 30px;
    background: #fff;
    height: 100%;
    overflow: auto;
}
.menu {
    padding: 20px 0;
    border-top: 1px solid rgba(232, 232, 232, 1);
}
.el-menu {
    border: none;
}
.el-menu-item {
    width: 260px;
    height: 40px;
    font-size: 14px;
    font-family: PingFang SC;
    font-weight: 500;
    line-height: 40px;
    color: rgba(34, 34, 34, 1);
    opacity: 1;
    margin-bottom: 18px;
    padding-left: 28px;
}
.el-menu-item i {
    float: right;
    margin-top: 14px;
    margin-right: 37px;
    height: 12px;
    line-height: 12px;
    width: 6.27px;
    /* color:rgba(24, 147, 252, 1); */
}
.head-img {
    height: 125px;
    justify-content: center;
    align-items: center;
    border-bottom: 1px solid rgba(232, 232, 232, 1);
    margin-bottom: 20px;
}
.head-img .user-head {
    width: 102px;
    height: 102px;
    background: #ccc;
    margin-right: 25px;
    border-radius: 50%;
    overflow: hidden;
}
.head-img img {
    width: 100%;
    height: 100%;
    display: inline-block;
}
.head-img .user-name {
    font-size: 20px;
    font-family: PingFang SC;
    font-weight: 600;
    line-height: 16px;
    color: rgba(51, 51, 51, 1);
    opacity: 1;
}
.head-img .upload-img-btn {
    margin-top: 20px;
    font-size: 14px;
    font-family: PingFang SC;
    font-weight: 400;
    line-height: 20px;
    color: rgba(0, 147, 255, 1);
    opacity: 1;
}
.resume-item-title {
    height: 40px;
    line-height: 30px;
    font-weight: 500;
}
.add-btn {
    height: 45px;
    background: rgba(255, 255, 255, 1);
    border: 1px solid rgba(232, 232, 232, 1);
    opacity: 1;
    text-align: center;
    line-height: 45px;
    font-size: 14px;
    font-family: PingFang SC;
    font-weight: 500;
    color: rgba(34, 34, 34, 1);
    opacity: 1;
    cursor: pointer;
}
.add-icon {
    font-size: 20px;
    color: #1893fc;
    position: relative;
    top: 3px;
    left: 5px;
    cursor: pointer;
}
.resume-item-title .title-text {
    font-size: 14px;
}
.resume-item-title .title-border {
    display: block;
    width: 20px;
    height: 3px;
    background: #1893fc;
}
.container-right /deep/ .el-input--small .el-input__inner {
    height: 44px;
    line-height: 44px;
}
.container-right /deep/ .el-form-item--small .el-form-item__label {
    height: 44px;
    line-height: 44px;
}
.experience {
    line-height: 44px;
    height: 100%;
    width: 100px;
    margin-left: 20px;
}
.picker-date /deep/ .el-date-editor {
    width: 100%;
}
/* .experience /deep/ .el-radio-group {
    width: 100%;
}
.experience /deep/ .el-radio {
    width: 100%;
} 
.experience /deep/ .el-radio__input {
    width: 30px;
    float: right;
    padding-left: 15px;
}
.experience /deep/ .el-radio__label {
    width: 30px;
    float: left;
    padding-left: 15px;
} */
.l-h40 {
    line-height: 40px;
}
.t-center {
    text-align: center;
}
.fs14 {
    font-size: 14px;
}
.w220 {
    width: 220px;
}
.w590 {
    width: 590px;
}
.h40 {
    height: 40px;
}
.d-inline {
    display: inline-block;
}
.ml5 {
    margin-left: 5px;
}
.ml10 {
    margin-left: 10px;
}
.c-555555 {
    color: #555555;
}
.d-flex {
    display: flex;
}
.flex-1 {
    flex: 1;
}
</style>